<?php echo XHtml::beginForm(array('/Cms/admin/modules/crud'), 'post', array('id'=>'FormCrud')); ?>
<?php XHtml::hightlightErrorFields();?>
<h3>Generate Crud</h3>
<div class="Input">
    <?php echo XHtml::activeLabelEx($model,'model', array('class'=>'Fieldname')); ?>
    <?php echo XHtml::activeTextField($model,'model',array('size'=>65)); ?>
    <div class="tooltip">
        Model class is case-sensitive. It can be either a class name (e.g. <code>Post</code>)
        or the path alias of the class file (e.g. <code>application.models.Post</code>).
        Note that if the former, the class must be auto-loadable.
    </div>
    <?php echo XHtml::error($model,'model'); ?>
</div>

<div class="Input">
    <?php echo XHtml::activeLabelEx($model,'controller', array('class'=>'Fieldname')); ?>
    <?php echo XHtml::activeTextField($model,'controller',array('size'=>65)); ?>
    <div class="tooltip">
        Controller ID is case-sensitive. CRUD controllers are often named after
        the model class name that they are dealing with. Below are some examples:
        <ul>
            <li><code>post</code> generates <code>PostController.php</code></li>
            <li><code>postTag</code> generates <code>PostTagController.php</code></li>
            <li><code>admin/user</code> generates <code>admin/UserController.php</code></li>
        </ul>
    </div>
    <?php echo XHtml::error($model,'controller'); ?>
</div>

<div class="Input sticky">
    <?php echo XHtml::activeLabelEx($model,'baseControllerClass', array('class'=>'Fieldname')); ?>
    <?php echo XHtml::activeTextField($model,'baseControllerClass',array('size'=>65)); ?>
    <div class="tooltip">
        This is the class that the new CRUD controller class will extend from.
        Please make sure the class exists and can be autoloaded.
    </div>
    <?php echo XHtml::error($model,'baseControllerClass'); ?>
</div>

<div class="Input">
    <?php echo XHtml::activeLabelEx($model,'template', array('class'=>'Fieldname')); ?>
    <?php echo XHtml::activeDropDownList($model,'template',$templates); ?>
    <div class="tooltip">
        Please select which set of the templates should be used to generated the code.
    </div>
    <?php echo XHtml::error($model,'template'); ?>
</div>

<div class="Action">
    <?php echo XHtml::submitButton('Generate',array('name'=>'generate')); ?>
</div>
<?php echo XHtml::endForm(); ?>
<?php
$cs = Yii::app()->ClientScript;
$cs->registerScriptFile(Yii::app()->theme->BaseUrl.'/scripts/common.js', CClientScript::POS_BEGIN);
?>